﻿@using MediaGarden.Models;
@{
    /* FlowPlayer video view
    */
    int width = Model.DisplayWidth;
    int height = Model.DisplayHeight;
    bool autoplay = (Model.AutoPlay == null) ? false : Model.AutoPlay;
    var playerId = Html.ViewData.TemplateInfo.GetFullHtmlFieldId("Player");
    Script.Require("FlowPlayer").AtHead();
}
<a 
	href="@Model.MediaUrl" 
    title="@Model.Title"
	style="display:block;width:@(width)px;height:@(height)px;" 
	id="@playerId">
</a>
<script language="JavaScript">
    flowplayer("@playerId", {
        clip: {
            url:"@Url.Content("~/Modules/MediaGarden.Players.FlowPlayer/Content/flowplayer/flowplayer-3.2.7.swf")",
            autoplay:@autoplay
        }
    });
</script>